[cherry-pick] promote exception to property, add test (#3471) - #3486
Conversation
There was a problem hiding this comment.
Pull request overview
Cherry-picks the fix from #3471 to address a blocking-path bug in ConfigurationManager<T> where metadata fetch failures could lose the original exception during the backoff window, preventing callers from classifying client (4xx) vs server (5xx) errors.
Changes:
- Promote the blocking-path fetch failure exception from a local variable to an instance field so it persists across calls within
_syncAfterbackoff. - Clear the persisted failure on successful retrieval/update to avoid stale errors.
- Add a regression test ensuring the inner exception (and
HttpDocumentRetriever.StatusCodeinException.Data) is preserved during the backoff window.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/Microsoft.IdentityModel.Protocols.OpenIdConnect.Tests/ConfigurationManagerTests.cs | Adds a regression test verifying the blocking backoff path preserves the original inner exception/status code. |
| src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs | Introduces an instance field to persist the most recent blocking-path fetch failure across calls. |
| src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager_Blocking.cs | Uses the persisted failure field (set on failure, cleared on success) when throwing during the backoff window. |
Mallika Chennupaty (mdchennu)
left a comment
There was a problem hiding this comment.
looks good to me, the comments added in the test were really helpful.
debchoudhury-id4s
left a comment
There was a problem hiding this comment.
was there a blocker preventing backporting #3471 earlier? Or was this timing intentional? Asking to learn about any possible release improvement.
The only blocker was lack of reviews |
…22.0 (#104) Updated [System.IdentityModel.Tokens.Jwt](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet) from 8.21.0 to 8.22.0. <details> <summary>Release notes</summary> _Sourced from [System.IdentityModel.Tokens.Jwt's releases](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases)._ ## 8.22.0 ## What's Changed * Promote exception to property, add test by @westin-m in AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3486 * Add IgnoreCaseWhenValidatingAudience flag to audience validation by @cpp11nullptr in AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3563 **Full Changelog**: AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet@8.21.0...8.22.0 Commits viewable in [compare view](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet@8.21.0...8.22.0). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
cherry pick #3471 into dev/8x